const names = ['ddd', 'ccc', 'aaa', 'bbb']
const container = document.querySelector('.container')
names.forEach(name => {
    let btn = document.createElement('button')
    btn.classList.add('btn')
    btn.innerText = name
    container.appendChild(btn)
})

const btn = document.querySelectorAll('.btn')
btn.forEach(item => {
    item.addEventListener('click', (e) => {
        console.log(e.target.innerText);
    })
})
